<template>
	<view>
		<view v-if="listtype!='chooselist'" :style="{'background-color':dataobj.tabsequence?'#f8f8f8':'#fff'}" style="padding: 8px 18px;color: #aaa;font-size: 14px; display: flex;flex-direction: row;justify-content: space-between;">
			<view style="display: flex;align-items: center;color: #666;"
				 :style="{'fontSize':clientType=='pda'?'20px':'14px'}">{{dataobj.colText}} 
				<view v-if="dataobj.tag_isNotEmpty" style="color: #F55C23;font-size: 6px;" class="iconfont icon-jiufuqianbaoicon14"> </view>
			</view>
			<view style="text-align: right;" :style="{'fontSize':clientType=='pda'?'20px':'14px'}" v-if="dataobj.tabsequence > 0 && dataobj.tag_dddwName!='' && dataobj.editStyle=='dddw' && isaddedit">
				<picker @change="bindPickerChange($event, customlist)" :value="index" :range="customlist" :range-key="'coldisplay'">
					<view class="uni-input">{{(dataobj.coldisplay==''||dataobj.coldisplay==undefined)?'请选择':dataobj.coldisplay}}</view>
				</picker>
			</view>
			<view style="text-align: right;" :style="{'fontSize':clientType=='pda'?'20px':'14px'}" v-else-if="dataobj.tabsequence > 0 && dataobj.tag_dddwName==''  && (dataobj.editStyle=='ddlb' || dataobj.editStyle=='radiobuttons') && isaddedit">
				<picker @change="bindPickerChange2($event, customlist)" :value="index" :range="customlist" :range-key="'displayValue'">
					<view class="uni-input">{{(dataobj.coldisplay==''||dataobj.coldisplay==undefined)?'请选择':dataobj.coldisplay}}  </view>
				</picker>
			</view>
			<view style="text-align: right;" :style="{'fontSize':clientType=='pda'?'20px':'14px'}" v-else-if="dataobj.tabsequence > 0 && dataobj.tag_dddwName=='' && isaddedit" @click="dataobj.tabsequence>0?selectitem():''" >
				<input :placeholder="dataobj.coldisplay" placeholder-style="font-size:14px;" :disabled="!dataobj.iscancursorinputwhenchoosedata" :value="dataobj.coldisplay"/> 
			</view>
			<view v-else :style="{'fontSize':clientType=='pda'?'20px':'14px'}">
				{{(dataobj.coldisplay==''||dataobj.coldisplay==undefined)?'请选择':dataobj.coldisplay}}
			</view>
		</view>
		<view v-else :style="{'background-color':!dataobj.tabsequence?'#fff':'#f8f8f8'}" style="padding: 13px 0px;color: #666;font-size: 14px; display: flex;flex-direction: row;justify-content: space-between;">
			<view style=" display: flex;align-items: center;">{{dataobj.colText}} 
				<view v-if="dataobj.isnotnull" style="color: #F55C23;font-size: 6px;" class="iconfont icon-jiufuqianbaoicon14"> </view>
			</view>
			<view style="text-align: right;color: #aaa;width: 60vw;text-align: left;" @click="dataobj.tabsequence?selectitem():''">
				<input :placeholder="dataobj.placeholder" placeholder-style="color:#aaa;font-size:14px;" :disabled="!dataobj.iscancursorinputwhenchoosedata" :value="dataobj.coldisplay"/> 
			</view>
		</view>
	</view>
</template>


<script>
	export default {
		props:{
			dataobj:{
				type:Object
			},
			headdata:{
				type:Object
			},
			listitemindex:{
				type:Number
			},
			listindex:{
				type:Number
			},
			listblockindex:{
				type:Number
			},
			listtype:{
				type:String
			},
			
			styletype:{
				type:String
			},
			datalist:{
				type:Array,
				default () {
					return []
				}
			},
			inputdetail:{
				type:Array,
				default () {
					return []
				}
			},
			
			
			customlist:{
				type:Array,
				default () {
					return []
				}
			},
			divArea:{
				type:String
			},
			pagename:{
				type:String
			},
			isaddedit:{
				type:Boolean
			},
			property:{
				type:Object
			},
			clientType:{
				type:String,
				default(){
					return ""
				}
			}
			
		},
		
		
		mounted: function(){
			var that = this
			console.log('this.dataobj', JSON.parse(JSON.stringify(this.dataobj)) )
			console.log(this.isaddedit)
			console.log('pageName',this.pagename)
		},
		
		
		
		methods:{
			bindPickerChange(event,customlist){
				var that = this
				that.dataobj.coldisplay = customlist[event.detail.value].coldisplay
				that.dataobj.value = customlist[event.detail.value].coldata
				that.dataobj.colValue = customlist[event.detail.value].coldata
				that.dataobj.ismodified = true
				uni.$emit("updatelist", that.divArea, that.listindex, that.listblockindex, that.listitemindex, that.dataobj,that.pagename)
			},
			
			bindPickerChange2(event,customlist){
				var that = this
				that.dataobj.coldisplay = customlist[event.detail.value].displayValue
				that.dataobj.value = customlist[event.detail.value].dataValue
				that.dataobj.colValue = customlist[event.detail.value].dataValue
				that.dataobj.ismodified = true
				uni.$emit("updatelist", that.divArea, that.listindex, that.listblockindex, that.listitemindex, that.dataobj,that.pagename)
			},
			
			
			
			selectitem(){
				var that = this
				
			},
		
		}
	}
</script>

<style>
</style>
